package com.company;
public class dalao {
    public static void main(String args[]){
        final bank bank=new bank();
        Thread tadd=new Thread(new Runnable() {
            @Override
            public void run() {
                while(true){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    bank.addMoney(100);
                    bank.lookMoney();
                }
            }
        });

        Thread tsub = new Thread(new Runnable() {
            @Override
            public void run() {
                while(true){
                    bank.subMoney(100);
                    bank.lookMoney();
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        tsub.start();
        tadd.start();
    }
}


